package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AppendixMapper;
import com.ruoyi.system.domain.Appendix;
import com.ruoyi.system.service.IAppendixService;
import com.ruoyi.common.core.text.Convert;

/**
 * 附件Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-04-13
 */
@Service
public class AppendixServiceImpl implements IAppendixService 
{
    @Autowired
    private AppendixMapper appendixMapper;

    /**
     * 查询附件
     * 
     * @param id 附件ID
     * @return 附件
     */
    @Override
    public Appendix selectAppendixById(Long id)
    {
        return appendixMapper.selectAppendixById(id);
    }

    /**
     * 查询附件列表
     * 
     * @param appendix 附件
     * @return 附件
     */
    @Override
    public List<Appendix> selectAppendixList(Appendix appendix)
    {
        return appendixMapper.selectAppendixList(appendix);
    }

    /**
     * 新增附件
     * 
     * @param appendix 附件
     * @return 结果
     */
    @Override
    public int insertAppendix(Appendix appendix)
    {
        return appendixMapper.insertAppendix(appendix);
    }

    /**
     * 修改附件
     * 
     * @param appendix 附件
     * @return 结果
     */
    @Override
    public int updateAppendix(Appendix appendix)
    {
        return appendixMapper.updateAppendix(appendix);
    }

    /**
     * 删除附件对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAppendixByIds(String ids)
    {
        return appendixMapper.deleteAppendixByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除附件信息
     * 
     * @param id 附件ID
     * @return 结果
     */
    @Override
    public int deleteAppendixById(Long id)
    {
        return appendixMapper.deleteAppendixById(id);
    }

    @Override
    public List<Appendix> listByDocTypeAndId(Long id, Integer docType) {
        return appendixMapper.listByDocTypeAndId(id,docType);
    }
}
